package com.whfc.common.enums;


/**
 * @author sun_guodong
 * @description
 * @date 2020-06-16
 */
public enum AppWeather {
    CLEAR_DAY("CLEAR_DAY", "晴", "qing"),
    CLEAR_NIGHT("CLEAR_NIGHT", "晴", "qing"),
    PARTLY_CLOUDY_DAY("PARTLY_CLOUDY_DAY", "多云", "duoyun"),
    PARTLY_CLOUDY_NIGHT("PARTLY_CLOUDY_NIGHT", "多云", "duoyun"),
    CLOUDY("CLOUDY", "阴", "yin"),
    LIGHT_HAZE("LIGHT_HAZE", "轻度雾霾", "qingduwumai"),
    MODERATE_HAZE("MODERATE_HAZE", "中度雾霾", "zhongduwumai"),
    HEAVY_HAZE("HEAVY_HAZE", "重度雾霾", "yanzhongwumai"),
    LIGHT_RAIN("LIGHT_RAIN", "小雨", "xiaoyu"),
    MODERATE_RAIN("MODERATE_RAIN", "中雨", "zhongyu"),
    HEAVY_RAIN("HEAVY_RAIN", "大雨", "dayu"),
    STORM_RAIN("STORM_RAIN", "暴雨", "baoyu"),
    FOG("FOG", "雾", "wu"),
    LIGHT_SNOW("LIGHT_SNOW", "小雪", "xiaoxue"),
    MODERATE_SNOW("MODERATE_SNOW", "中雪", "zhongxue"),
    HEAVY_SNOW("HEAVY_SNOW", "大雪", "daxue"),
    STORM_SNOW("STORM_SNOW", "暴雪", "baoxue"),
    DUST("DUST", "浮尘", "fucheng"),
    SAND("SAND", "沙尘", "shacheng"),
    WIND("WIND", "大风", "dafeng");

    private String value;

    private String desc;

    private String icon;

    AppWeather(String value, String desc, String icon) {
        this.value = value;
        this.desc = desc;
        this.icon = icon;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public static AppWeather parseValue(String value){
        AppWeather appWeather = null;
        switch (value){
            case "CLEAR_DAY":
                appWeather = CLEAR_DAY;
                break;
            case "CLEAR_NIGHT":
                appWeather = CLEAR_NIGHT;
                break;
            case "PARTLY_CLOUDY_DAY":
                appWeather = PARTLY_CLOUDY_DAY;
                break;
            case "PARTLY_CLOUDY_NIGHT":
                appWeather = PARTLY_CLOUDY_NIGHT;
                break;
            case "CLOUDY":
                appWeather = CLOUDY;
                break;
            case "LIGHT_HAZE":
                appWeather = LIGHT_HAZE;
                break;
            case "MODERATE_HAZE":
                appWeather = MODERATE_HAZE;
                break;
            case "HEAVY_HAZE":
                appWeather = HEAVY_HAZE;
                break;
            case "LIGHT_RAIN":
                appWeather = LIGHT_RAIN;
                break;
            case "MODERATE_RAIN":
                appWeather = MODERATE_RAIN;
                break;
            case "HEAVY_RAIN":
                appWeather = HEAVY_RAIN;
                break;
            case "STORM_RAIN":
                appWeather = STORM_RAIN;
                break;
            case "FOG":
                appWeather = FOG;
                break;
            case "LIGHT_SNOW":
                appWeather = LIGHT_SNOW;
                break;
            case "HEAVY_SNOW":
                appWeather = HEAVY_SNOW;
                break;
            case "STORM_SNOW":
                appWeather = STORM_SNOW;
                break;
            case "DUST":
                appWeather = DUST;
                break;
            case "MODERATE_SNOW":
                appWeather = MODERATE_SNOW;
                break;
            case "SAND":
                appWeather = SAND;
                break;
            case "WIND":
                appWeather = WIND;
                break;
            default:
                appWeather = WIND;
                break;
        }

        return appWeather;
    }
}
